Repository navigation
fix empty chat displayed in focus mode - #40336
Conversation
| const report2 = LHNTestUtils.getFakeReport([3, 4], 2, true); | ||
| const report3 = LHNTestUtils.getFakeReport([5, 6], 1, true); | ||
| const report4 = LHNTestUtils.getFakeReport([7, 8], 0, true); | ||
| const report1 = {...LHNTestUtils.getFakeReport([1, 2], 3, true), lastMessageText: 'test'}; |
There was a problem hiding this comment.
Add lastMessageText to getFakeReport
There was a problem hiding this comment.
Actually let's not block on this. I see getFakeReport used in many places where we just extend its response
Reviewer Checklist
Screenshots/Videos |
flodnv
left a comment
There was a problem hiding this comment.
Looks good but can we do this too?
I'm not sure why we named this like that, but seeing as it's called "focus" mode through the stack, let's name this to isInFocusMode
|
@flodnv Apologies, I'm not entirely clear on your meaning:
Please indicate where it's referenced as "focus" mode by commenting on the code. Thanks |
| return [createdActionForChat, createdActionForIOUReport, iouAction, transactionThread, createdActionForTransactionThread]; | ||
| } | ||
|
|
||
| // Check if the report is empty report |
There was a problem hiding this comment.
We should use comments to be descriptive and explain why or how the code is doing so and so, instead of using comments to repeat what the code is already saying.
So here, we can say something like:
// Check if the report is empty, meaning it has no visible messages (i.e. only a "created" report action).
|
It looks like this PR may have broken |
|
I am investigating the |
|
Any update on this? |
|
I am still investigating how to pass the perf test. @s77rt. Do you have any suggestions? |
|
@tienifr In the const report = {...LHNTestUtils.getFakeReport(participants, 1, true), lastMessageText: 'hey'}; |
|
Setting myself a reminder to merge on Monday - https://expensify.slack.com/archives/C01GTK53T8Q/p1715105636003919 |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/flodnv in version: 1.4.73-0 🚀
|
|
This PR is failing because of issue #42070 330089805-c1565812-33b6-4347-af2a-53d104cba0cb.mp4 |
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.4.73-7 🚀
|
| if (!report) { | ||
| return true; | ||
| } | ||
| const lastVisibleMessage = ReportActionsUtils.getLastVisibleMessage(report.reportID); |
There was a problem hiding this comment.
Coming from this bug #43994, we should have used ReportUtils.getLastVisibleMessage instead of ReportActionsUtils.getLastVisibleMessage to avoid such a bug, more context in #43994 (comment)
There was a problem hiding this comment.
Why do we have two functions? We should merge into one. Looking at the function names alone you can't tell which one to use
There was a problem hiding this comment.
The only difference is that when a message is deleted:
ReportUtils.getLastVisibleMessagewill return[Deleted message];ReportActionsUtils.getLastVisibleMessagewill return an empty string'';
There was a problem hiding this comment.
Hm, I agree this is error prone and will tend to lead to more bugs.







Details
Fixed Issues
$ #38368
PROPOSAL: #38368 (comment)
Tests
(You)at the end.Offline tests
QA Steps
(You)at the end.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2024-04-17.at.15.34.25.mov
Android: mWeb Chrome
Screen.Recording.2024-04-17.at.15.32.50.mov
iOS: Native
Screen.Recording.2024-04-17.at.15.29.27.mov
iOS: mWeb Safari
Screen.Recording.2024-04-17.at.15.27.22.mov
MacOS: Chrome / Safari
Screen.Recording.2024-04-17.at.15.09.26.mov
MacOS: Desktop
Screen.Recording.2024-04-17.at.15.23.41.mov